package com.HelloSpring.DI;

import com.HelloSpring.DI.SpellChecker;

public class TextEditor {
	private SpellChecker spellChecker;
	private String _spellString;
	public TextEditor() {
		
	}
	public TextEditor(String spellString) {
		System.out.println("TextEditor(String spellString)");
		this._spellString = spellString;
	}

	public void spellCheck() {
		if (_spellString !=null && _spellString.length() > 0) {
			System.out.println(_spellString);
		} else {
			spellChecker.checkSpelling();
		}
	}

	public void setSpellChecker(SpellChecker spellChecker) {
		System.out.println("Inside TextEditor constructor.");
		this.spellChecker = spellChecker;
	}

	public SpellChecker getSpellChecker() {
		return this.spellChecker;
	}
}